/* 定义全局变量 */
:root {
    --primary-color: #2d3e50;
    --secondary-color: #f9fafc;
    --accent-color: #2d8cf0;
    --hover-color: #1971c2;
    --text-dark: #333;
    --text-light: #666;
    --white: #ffffff;
    --shadow: rgba(0, 0, 0, 0.2);
}

/* 通用样式 */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: var(--secondary-color);
    color: var(--text-dark);
}

a {
    text-decoration: none;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: auto;
}

/* 导航栏样式 */
.navbar {
    width: 100%;
    background-color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
}

.navbar a {
    color: var(--white);
    padding: 10px 20px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.navbar a:hover {
    background-color: #1a2a3b;
    border-radius: 5px;
}

.last_li {
    margin-left: auto;
}

.toRight {
    margin-left: 20px;
}

/* 主体内容 */
.chat-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 20px;
    flex-wrap: wrap; /* 防止溢出，允许换行 */
    gap: 20px; /* 增加间隙 */
}

.chat-suggestions,
.chat-topics {
    width: 25%;
    background-color: var(--white);
    padding: 15px;
    margin: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 8px var(--shadow);
    flex: 1;
}

.chat-suggestions h3,
.chat-topics h3 {
    color: var(--primary-color);
    font-size: 1.4em;
}

.chat-suggestions ul,
.chat-topics ul {
    list-style-type: none;
    padding: 0;
}

.chat-suggestions li,
.chat-topics li {
    margin-bottom: 10px;
}

.chat-suggestions button,
.chat-topics button {
    background-color: var(--accent-color);
    color: var(--white);
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.chat-suggestions button:hover,
.chat-topics button:hover {
    background-color: var(--hover-color);
}

/* 聊天窗口 */
.chat-window {
    width: 50%;
    background-color: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px var(--shadow);
    flex: 2;
}

.chat-history {
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.chat-message {
    margin-bottom: 10px;
}

.chat-message p {
    font-size: 1em;
    margin: 0;
}

.chat-message.bot {
    background-color: #e0e0e0;
    padding: 10px;
    border-radius: 5px;
}

.chat-message.user {
    background-color: #a1c4fd;
    padding: 10px;
    border-radius: 5px;
    text-align: right;
}

.chat-time {
    font-size: 0.8em;
    color: var(--text-light);
}

/* 输入框和按钮 */
.chat-input {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-input input {
    width: 80%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
}

.chat-input button {
    background-color: var(--accent-color);
    color: var(--white);
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.chat-input button:hover {
    background-color: var(--hover-color);
}

/* 底部 */
footer {
    text-align: center;
    padding: 20px;
    background-color: var(--primary-color);
    color: var(--white);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
        align-items: center;
    }

    .chat-suggestions,
    .chat-topics {
        width: 100%;
        margin-bottom: 20px;
    }

    .chat-window {
        width: 100%;
    }
}

/* 新增聊天历史按钮样式 */
.chat-history-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.chat-history-actions button {
    background-color: var(--accent-color);
    color: var(--white);
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.chat-history-actions button:hover {
    background-color: var(--hover-color);
}
